from django.urls import path
from .views import (
    OrderListView, OrderDetailView, OrderCreateView, OrderCancelView,
    OrderAdminListView, OrderAdminUpdateView,
    ShippingAddressListView, ShippingAddressDetailView,
    RefundRequestListView, RefundRequestAdminListView,
    RefundRequestAdminUpdateView, order_stats, admin_order_stats
)

urlpatterns = [
    path('orders/', OrderListView.as_view(), name='order-list'),
    path('orders/create/', OrderCreateView.as_view(), name='order-create'),
    path('orders/<int:pk>/', OrderDetailView.as_view(), name='order-detail'),
    path('orders/<int:pk>/cancel/', OrderCancelView.as_view(), name='order-cancel'),
    path('admin/orders/', OrderAdminListView.as_view(), name='order-admin-list'),
    path('admin/orders/<int:pk>/', OrderAdminUpdateView.as_view(), name='order-admin-update'),
    
    path('shipping-addresses/', ShippingAddressListView.as_view(), name='shipping-address-list'),
    path('shipping-addresses/<int:pk>/', ShippingAddressDetailView.as_view(), name='shipping-address-detail'),
    
    path('refund-requests/', RefundRequestListView.as_view(), name='refund-request-list'),
    path('admin/refund-requests/', RefundRequestAdminListView.as_view(), name='refund-request-admin-list'),
    path('admin/refund-requests/<int:pk>/', RefundRequestAdminUpdateView.as_view(), name='refund-request-admin-update'),
    
    path('stats/', order_stats, name='order-stats'),
    path('admin/stats/', admin_order_stats, name='admin-order-stats'),
]
